#!/bin/bash
# build gurb and intall,this grub is used for 
# disk encryption
. /opt/hygon/common.sh

os_release=$(eval get_os_release)
case $os_release in
     "anolis")
             ;;
     "centos")
		source /opt/rh/devtoolset-8/enable
             ;;
     "ubuntu")
             ;;
     esac


patch  -p1</opt/hygon/csv/grub.patch
./autogen.sh
./configure --target=x86_64 --with-platform=efi -prefix=/grub
make -j$(getconf _NPROCESSORS_ONLN)
make install DESTDIR=/opt/
cd /opt/
tar zcvf /opt/hygon/csv/grub.tar.gz grub/
